requetData()
function requetData() {
    $.ajax({
        url:"/gamedetails/gamedetailslist" ,
        dataType:"json",
        type:"get",
        success:function (data) {
            console.log(data)
            showData(data)
        }
    })
}

function add0(m){return m<10?'0'+m:m }

function format(shijianchuo)
{
    var time = new Date(shijianchuo);
    var y = time.getFullYear();
    var m = time.getMonth()+1;
    var d = time.getDate()+1;
    return y+'-'+add0(m)+'-'+add0(d);
}

function addshoppingcar() {
    // 所有验证判断都通过后，执行保存操作
    var gameId = $('input[ name="gameId"]').val()
    console.info(gameId)
    $.ajax({
        url:"/shoppingcar/addcar",
        data:"gameId=" + gameId,
        type:"post",
        success:function (data) {
            if (data=="success"){
                alert("添加成功")
                setTimeout(function () {
                }, 1000)
            }
            else {
                alert("添加失败")
            }
        }
    })
}